const mysql = require('mysql2');

// 创建连接池
const pool = mysql.createPool({
  host: 'localhost',
  user: 'root',
  password: '',
  database: 'log', // 修正：数据库名称是 log，表名是 lib_tool
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
});

// 获取 Promise 包装的连接池
const promisePool = pool.promise();

module.exports = promisePool; 